cos ka formula